package org.ahead4.joint.dto;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import org.ahead4.joint.utils.SignUtils;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 响应信封
 * @author WangYu
 * @title: RequestEnvelope
 * @description: TODO
 * @date 2020/3/1314:44
 */
@Data
public class ResponseEnvelope {
    private Integer code;
    private String msg;
    private String sign;
    private Long stamptime;
    public String toJSONString() {
        return JSON.toJSONString(this);
    }

    public boolean isSuccessful() {
        return this.code >= 200 && this.code < 300;
    }

    public static ResponseEnvelope parse(String json) {
        return JSON.parseObject(json, ResponseEnvelope.class);
    }

}
